from typing import *


class Solution:
    def isArraySpecial(self, nums: List[int], queries: List[List[int]]) -> List[bool]:
        n = len(nums)
        f = [0] * n
        for i, num in enumerate(nums):
            if i > 0 and nums[i - 1] & 1 != num & 1:
                f[i] = f[i - 1] + 1
            else:
                f[i] = 1
        ans = []
        for l, r in queries:
            ans.append(l >= r - f[r] + 1)
        return ans
